import { Component, OnInit } from '@angular/core';
import { AuthService } from '../auth.service';

@Component({
  selector: 'app-left-menu',
  templateUrl: './left-menu.component.html',
  styleUrls: ['./left-menu.component.css']
})
export class LeftMenuComponent implements OnInit {
  username: string = '';
  identity: string = ''; // 用户身份信息

  constructor(private authService: AuthService) {}

  ngOnInit(): void {
    const accountInfo = this.authService.getAccountInfo();
    if (accountInfo) {
      this.username = accountInfo.username;
      this.identity = accountInfo.identity; // 获取用户身份信息
    }
  }
}
